package com.atguigu.jxc.dao;

import com.atguigu.jxc.entity.PurchaseList;
import com.atguigu.jxc.entity.PurchaseListGoods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Author: dongdong lau
 * @CreateTime: 2021/7/23 11:12
 * @Description: 商品入库dao层接口
 */
@Mapper
public interface PurchaseDao {

    /**
     * 新增出货单 (PurchaseList表)
     * @param purchaseList
     * @return
     */
    Integer savePurchasePurchaseList(PurchaseList purchaseList);

    /**
     * 新增出货单 (purchaseListGoods表)
     * @param purchaseListGoods
     * @return
     */
    Integer savePurchasePurchaseListGoods(PurchaseListGoods purchaseListGoods);

    /**
     * 加库存
     * @param goodsId
     * @param goodsNum
     * @return
     */
    Integer reduceGoods(@Param("goodsId") Integer goodsId, @Param("goodsNum") Integer goodsNum);

    /**
     * 进货单列表展示
     * @param purchaseNumber
     * @param supplierId
     * @param state
     * @param sTime
     * @param eTime
     * @return
     */
    List<PurchaseList> list(@Param("purchaseNumber") String purchaseNumber,
                            @Param("supplierId") Integer supplierId,
                            @Param("state") Integer state,
                            @Param("sTime") String sTime,
                            @Param("eTime") String eTime);

    /**
     * 查询商品信息
     * @param purchaseListId
     * @return
     */
    List<PurchaseListGoods> getPurchaseListGoodsById(@Param("purchaseListId") Integer purchaseListId);

    /**
     * 根据purchaseListId删除进货单数据
     * @param purchaseListId
     * @return
     */
    Integer deletePurchaseListById(@Param("purchaseListId") Integer purchaseListId);
}
